//
//  NumberViewModel.swift
//  Automobile
//
//  Created by erkebulan elzhan on 8/19/20.
//  Copyright © 2020 erkebulan elzhan. All rights reserved.
//

import Foundation


class NumberViewModel {
    
    struct Number: Decodable {
        var phone: String
        var id: Int
        
    }
    
    public func loadNumbers (request: URLRequest, completion: @escaping (Result<Response<[Number]>, RequestError>) -> Void) {
        Backend().fetchFromBackend(for: Response<[Number]>.self, request: request, statusCode: 200) { (result) in
            completion(result)
        }
    }
    
    var myNumbers: [Number] = []
    
}

